<template>
  <el-dialog v-if="dialogFormVisible" v-el-drag-dialog :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="900px" :title="winTitle" @close="handleDialogClose">
    <div v-if="loading" v-loading="loading" class="el-dialog__body" />
    <el-table v-if="!showSubmitHandle" :data="wfItemList" border style="width: 100%" :row-class-name="rowClassName">
      <el-table-column label="序号" type="index" width="45" align="center" />
      <el-table-column label="文件标题" prop="title" />
      <el-table-column label="文件类型" prop="wfName" width="140" align="center" />
      <el-table-column label="处理环节" prop="wfNodeName" width="140" align="center" />
      <el-table-column label="处理状态" prop="limitTime" width="90" align="center">
        <template slot-scope="scope">
          <i v-if="scope.row.icon!=undefined" :class="'el-icon-'+scope.row.icon" />
        </template>
      </el-table-column>
    </el-table>

    <!-- 批量提交办理 -->
    <el-form v-if="!loading&&showSubmitHandle" class="form-container">
      <div class="el-table el-table--fit el-table--border">
        <div class="el-table__body-wrapper">
          <table class="el-table__body" cellspacing="0" cellpadding="0" border="0">
            <tbody>
              <tr>
                <td class="tdlbl tdw17 ">文件标题</td>
                <td class="tdcont tdw83" colspan="3">
                  {{ wfItemList[processIndex].title||wfItemList[processIndex].flSubject }}
                </td>
              </tr>
              <tr>
                <td class="tdlbl tdw17 ">文件类型</td>
                <td class="tdcont tdw33">  {{ wfItemList[processIndex].wfName||wfItemList[processIndex].flFormName }} </td>
                <td class="tdlbl tdw17 ">处理环节</td>
                <td class="tdcont tdw33">  {{ wfItemList[processIndex].wfNodeName||wfItemList[processIndex].wfNodeNames }}  </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </el-form>

    <SubmitHandle v-if="showSubmitHandle==true&&wfJsonData!=undefined&&submitHandle!=null" :cur-t-n="curTN" :wf-instance="wfInstance" :submit-handle="submitHandle" :wf-json-data="wfJsonData" :common-idea-list="commonIdeaList" :submit-template-list="submitTemplateList" />
    <div v-if="showSubmitHandle==true&&wfJsonData!=undefined&&submitHandle!=null" slot="footer" class="dialog-footer">
      <el-button plain icon="el-icon-close" type="default" @click="handleDialogClose">取 消</el-button>
      <el-button icon="el-icon-check" type="primary" @click="handleSubmitForm">确 定</el-button>
    </div>

    <SelectOuterDeputy />
  </el-dialog>

</template>

<script>
import qs from 'qs'
import { getQueryObject, sortByKey } from '@/global/utils/index'

export default {
    name: 'BatchProcessing',
    components: {

    },
    props: {

    },
    data() {
        return {
            winTitle: '',
            dialogFormVisible: false,
            showSubmitHandle: false,
            actionType: '',
            wfItemList: [],
            wfInstance: {},
            vo: {},
            wfJsonData: {},
            submitHandle: null,
            commonIdeaList: [],
            submitTemplateList: [],
            curTN: {},
            attachments: [],
            submitedFile: {},
            processIndex: 0,
            loading: false
        }
    },
    computed: {

    },
    watch: {

    },
    created() {
        this.$bus.on('startBatchProcessFiles', this.startBatchProcessFiles)
    },
    beforeDestroy() {
        this.$bus.off('startBatchProcessFiles', this.startBatchProcessFiles)
    },
    mounted() {

    },
    methods: {
        getSelectedRows($scope) {
            let selectedRows = []
            for (let i = 0; i < $scope.$children.length; i++) {
                if ($scope.$children[i].selectedRows !== undefined) {
                    selectedRows = $scope.$children[i].selectedRows
                }
            }

            return sortByKey(selectedRows, 'createTime', 'desc')
        },
        startBatchProcessFiles($scope, actionType, args, itemType) {
            this.loading = true
            this.winTitle = ''
            this.actionType = actionType

            const wfItemList = this.getSelectedRows($scope)

            if (actionType === 'attend') { // 关注、取消关注
                this.setAttend($scope, wfItemList, args, itemType)
                return
            } else if (actionType === 'forward') { // 转派
                this.wfItemList = wfItemList
                this.forwardTodo($scope, wfItemList)
                return
            } else if (actionType === 'pause') { // 挂起
                this.setPause($scope, wfItemList, 3)
                return
            } else if (actionType === 'resume') { // 解挂
                this.setPause($scope, wfItemList, 0)
                return
            } else if (actionType === 'restore') { // 废纸篓还原
                this.batchRestoreFile($scope, wfItemList)
                return
            } else if (actionType === 'oneTodo') { // 行操作列“办理”按钮快捷办文，一次一份，不需要打开流程表单
                this.showSubmitHandle = true
                this.winTitle = args.winTitle
                this.wfItemList = [args.wfItem]
                this.dialogFormVisible = true

                this.$nextTick(() => {
                    this.processFile(0)
                })
            } else if (actionType === 'continue') { // 连续办文，不需要打开流程表单
                if (wfItemList.length === 0) {
                    this.$alert('请选择需要连续办理的文件！', '操作提示', { type: 'warning' })
                    return
                }
                this.wfItemList = wfItemList

                this.showSubmitHandle = true
                this.winTitle = '连续办文'

                this.dialogFormVisible = true

                this.$nextTick(() => {
                    this.processFile(0)
                })
            } else {
                if (wfItemList.length === 0) {
                    this.$alert('请选择需要批量' + (actionType === 'writeoff' ? '注销' : '处理') + '的文件！', '操作提示', { type: 'warning' })
                    return
                }

                new Promise((resolve, reject) => {
                    if (actionType === 'todo') {
                        this.showSubmitHandle = true
                        this.winTitle = '批量办文'
                        // 流程名称、环节名称必须相同
                        for (let i = 0; i < wfItemList.length; i++) {
                            if (!wfItemList[i].itemUrl) {
                                let listDataUrl = ''
                                if (this.$vnode.context.moduleInfo) {
                                    listDataUrl = this.$vnode.context.moduleInfo.listDataUrl
                                } else {
                                    listDataUrl = this.$parent.$vnode.context.moduleInfo.listDataUrl
                                }

                                if (listDataUrl.substring(0) === '/') listDataUrl = listDataUrl.substring(1)
                                listDataUrl = listDataUrl.split('/')
                                let itemUrl = 'wfEngineUrl=' + listDataUrl[0] + '/' + listDataUrl[1]
                                itemUrl += '&busiDataId=' + wfItemList[i].id

                                this.$set(wfItemList[i], 'itemUrl', itemUrl)
                                this.$set(wfItemList[i], 'title', wfItemList[i].flSubject)
                                this.$set(wfItemList[i], 'wfNodeName', wfItemList[i].wfNodeNames)
                                this.$set(wfItemList[i], 'wfName', (wfItemList[i].wfName || this.$vnode.context.formTitle || this.$parent.$vnode.context.formTitle))
                            }

                            if (i > 0) {
                                if (wfItemList[i].wfName !== wfItemList[0].wfName || wfItemList[i].wfNodeName !== wfItemList[0].wfNodeName) {
                                    this.$alert('您选择的文件类型或处理环节不一致，无法批量办理！', '操作提示', { type: 'warning' })
                                    return
                                } else if (wfItemList[i].orgCode !== wfItemList[0].orgCode) {
                                    this.$alert('您选择的文件不属于同一单位，无法批量办理！', '操作提示', { type: 'warning' })
                                    return
                                }
                                delete wfItemList[i].icon
                            }
                        }
                        resolve(true)
                    } else if (actionType === 'toread') {
                        this.winTitle = '批量阅文'
                        resolve(true)
                    } else if (actionType === 'writeoff') {
                        this.$confirm('您是否确认批量注销文件？', '确认操作', { type: 'warning' })
                            .then(() => {
                                this.winTitle = '批量注销'

                                for (let i = 0; i < wfItemList.length; i++) {
                                    if (!wfItemList[i].itemUrl) {
                                        let listDataUrl = ''
                                        if (this.$vnode.context.moduleInfo) {
                                            listDataUrl = this.$vnode.context.moduleInfo.listDataUrl
                                        } else {
                                            listDataUrl = this.$parent.$vnode.context.moduleInfo.listDataUrl
                                        }

                                        if (listDataUrl.substring(0) === '/') listDataUrl = listDataUrl.substring(1)
                                        listDataUrl = listDataUrl.split('/')
                                        let itemUrl = 'wfEngineUrl=' + listDataUrl[0] + '/' + listDataUrl[1]
                                        itemUrl += '&busiDataId=' + wfItemList[i].id

                                        wfItemList[i].itemUrl = itemUrl
                                    }
                                }

                                resolve(true)
                            })
                            .catch(err => {
                                if (err !== 'cancel') {
                                    console.error(err)
                                }
                                reject(err)
                            })
                    } else {
                        this.$alert('批量处理指令“' + actionType + '”无效！', '操作提示', { type: 'warning' })
                        reject(false)
                    }
                }).then(result => {
                    this.wfItemList = wfItemList
                    this.dialogFormVisible = true

                    this.$nextTick(() => {
                        this.processFile(0)
                    })
                })
            }
        },
        processFile(index, submitHandle) {
            this.processIndex = index

            if (index >= this.wfItemList.length) {
                if (this.actionType === 'oneTodo') {
                    this.$message({ type: 'success', message: '已处理成功！' })
                    this.handleDialogClose()
                } else if (this.actionType === 'continue') {
                    this.$message({ type: 'success', message: '共' + this.wfItemList.length + '份文件已连续处理完成！' })
                    this.handleDialogClose()
                } else {
                    this.$message({ type: 'success', message: this.winTitle + '已处理完成！', showClose: true, onClose: () => {
                        this.handleDialogClose()
                    }
                    })
                }

                const btnRefresh = document.querySelector('.el-icon-refresh')
                if (btnRefresh !== null) btnRefresh.parentElement.click()

                return
            } else if (this.actionType === 'continue' && index > 0) {
                this.showSubmitHandle = false
                this.$nextTick(() => {
                    this.showSubmitHandle = true
                })
            }

            const wfItem = this.wfItemList[index]
            this.$set(wfItem, 'icon', 'loading')

            if (this.submitedFile[wfItem.itemUrl]) {
                this.$set(wfItem, 'icon', this.submitedFile[wfItem.itemUrl])
                this.processFile(++index, submitHandle)
                return
            }

            const wfParams = getQueryObject(wfItem.itemUrl)
            wfParams.openType = 'BatchSubmit'

            this.$wfEngine.loadWfInstance(this, wfParams).then(rst => {
                this.loading = false

                if (rst.code === 'success') {
                    if (this.actionType === 'toread') {
                        this.$set(wfItem, 'icon', 'check')
                        this.processFile(++index)
                    } else if (this.actionType === 'writeoff') {
                        this.$wfEngine.saveWfInstance(this, 'WriteOff', wfParams).then(res => {
                            if (res.code === 'success') {
                                this.$set(wfItem, 'icon', 'check')
                            } else {
                                this.$set(wfItem, 'icon', 'close')
                            }
                            this.processFile(++index)
                        })
                    } else if (this.actionType === 'todo' && index > 0) {
                        const submitTemplate = JSON.parse(submitHandle)

                        if (this.checkSubmitTemplate(this, submitTemplate)) {
                            submitTemplate.elevel = this.vo.flELevel
                            if (this.vo.passenger && this.vo.passenger.flELevelOptions && this.vo.passenger.flELevelOptions.length > 0) {
                                this.vo.passenger.flELevelOptions.forEach(elevel => {
                                    if (elevel.value === this.vo.flELevel) {
                                        submitTemplate.elvVal = elevel.level
                                    }
                                })
                            }

                            this.wfInstance.passenger.busiData = this.vo
                            const saveData = { wfInstance: JSON.stringify(this.wfInstance), curTN: JSON.stringify(this.curTN), submitHandle: JSON.stringify(submitTemplate) }
                            saveData.wfInstance = saveData.wfInstance.replace(/ src=\"http(.*?)\/workflow\/wfBusiAttach\/downloadById/g, ' src="/workflow/wfBusiAttach/downloadById')
                            console.log('BatchTestSubmit', this.vo.flSubject, submitTemplate)

                            if (submitTemplate.submitType === 'BatchTestSubmit') {
                                // 模拟指办理，直接返回成功
                                this.submitedFile[wfItem.itemUrl] = { 'icon': 'check' }
                                this.$set(wfItem, 'icon', 'check')
                                this.processFile(++index, submitHandle)
                            } else {
                            // 提交表单
                                this.$http({
                                    method: 'POST',
                                    headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' },
                                    data: qs.stringify(saveData),
                                    url: (wfParams.wfEngineUrl || 'workflow/wfInstance') + '/saveWfInstance'
                                }).then(res => {
                                    if (res.code === 'success') {
                                        this.submitedFile[wfItem.itemUrl] = { 'icon': 'check' }
                                        this.$set(wfItem, 'icon', 'check')
                                    } else {
                                        this.submitedFile[wfItem.itemUrl] = { 'icon': 'close' }
                                        this.$set(wfItem, 'icon', 'close')
                                    }
                                    this.processFile(++index, submitHandle)
                                })
                            }
                        } else {
                            this.$set(wfItem, 'icon', 'close')
                            this.processFile(++index, submitHandle)
                        }
                    } else if (this.actionType === 'todo' && index === 0) {
                        if (this.curTN.tnNodeID === null) {
                            this.$alert('您不是“' + (wfItem.flSubject || wfItem.title) + '”的当前处理人，不能办理！', '操作提示',
                                { type: 'warning', callback: () => {
                                    this.handleDialogClose()
                                } })
                        }
                    }
                } else {
                    this.$set(wfItem, 'icon', 'close')
                    this.processFile(++index)
                }
            })
        },
        checkSubmitTemplate($scope, submitTemplate) {
            // 检查第一份文件选择的路径、环节、处理人是否可用
            let routeChecked = false
            let wfNodeChecked = true
            let wfUserChecked = true

            for (let i = 0; i < $scope.wfJsonData.routes.length; i++) {
                if ($scope.wfJsonData.routes[i].name === submitTemplate.submitRoute.name || $scope.wfJsonData.routes[i].name.indexOf('-->' + submitTemplate.submitRoute.name) !== -1) {
                    routeChecked = true
                    for (let j = 0; j < submitTemplate.nextTNProp.length; j++) {
                        wfNodeChecked = false
                        const tnProp = submitTemplate.nextTNProp[j]

                        for (let k = 0; k < $scope.wfJsonData.routes[i].taskNodes.length; k++) {
                            if ($scope.wfJsonData.routes[i].taskNodes[k].name === tnProp.name) {
                                tnProp.wfNodeChecked = true// 有效环节

                                wfNodeChecked = true
                                tnProp.id = $scope.wfJsonData.routes[i].taskNodes[k].id

                                if ($scope.wfJsonData.routes[i].taskNodes[k].showNodeUsers === 0) {
                                    // 自动全选、并且不显示处理人，使用候选处理人替换模板中的处理人
                                    if ($scope.wfJsonData.routes[i].taskNodes[k].users && $scope.wfJsonData.routes[i].taskNodes[k].users.length > 0) {
                                        let nextUsers = ''
                                        $scope.wfJsonData.routes[i].taskNodes[k].users.forEach(tnUser => {
                                            if (nextUsers !== '') nextUsers += ';'
                                            nextUsers += tnUser.orgFullName + ':' + tnUser.name + '/' + tnUser.account + '@' + tnUser.id
                                        })
                                        submitTemplate.nextTNUser[j] = nextUsers
                                    } else if ($scope.wfJsonData.routes[i].taskNodes.length === 1) {
                                        wfUserChecked = false // 路径下只有一个节点、并且无处理人
                                    } else if ($scope.wfJsonData.routes[i].taskNodes[k].users === null) {
                                        // 存在多个环节，但其中一个环节无处理人
                                        submitTemplate.nextTNProp.splice(j, 1)
                                        submitTemplate.nextTNUser.splice(j--, 1)
                                    }
                                } else {
                                    const tnUsers = JSON.stringify($scope.wfJsonData.routes[i].taskNodes[k].users)
                                    const nextUsers = submitTemplate.nextTNUser[j].split(';')
                                    for (let m = 0; m < nextUsers.length; m++) {
                                        let staffId = nextUsers[m].split('@')[1]
                                        if (staffId.indexOf('#') !== -1) staffId = staffId.split('#')[0]
                                        if (tnUsers.indexOf(staffId) === -1 && tnUsers.indexOf('asyncLoadingUsers') === -1) {
                                            if ($scope.wfJsonData.routes[i].taskNodes[k].users.length === 1 && nextUsers.length === 1) {
                                                // 候选处理人只有1人，使用候选处理人替换模板中的处理人
                                                let tnUser = $scope.wfJsonData.routes[i].taskNodes[k].users[0]
                                                tnUser = tnUser.orgFullName + ':' + tnUser.name + '/' + tnUser.account + '@' + tnUser.id

                                                submitTemplate.nextTNUser[j] = tnUser
                                            } else {
                                                wfUserChecked = false
                                                break
                                            }
                                        }
                                    }
                                }

                                $scope.wfJsonData.routes[i].taskNodes.splice(k--, 1)// 删除已经检查过的节点
                                break // k
                            }
                        }

                        if (!tnProp.wfNodeChecked) {
                            // 办理模板存在、流程实例路径后续环节不存在的节点，不能提交，需要删除
                            submitTemplate.nextTNProp.splice(j--, 1)
                        }

                        if (!wfNodeChecked || !wfUserChecked) break // j
                    }

                    if ($scope.wfJsonData.routes[i].taskNodes.length > 0) {
                        // 第二份文件候选节点，还存在第一份办理操作未选择处理人的节点
                        for (let n = 0; n < $scope.wfJsonData.routes[i].taskNodes.length; n++) {
                            console.log('BatchSubmit: $scope.wfJsonData.routes[i].taskNodes[n]', n, $scope.wfJsonData.routes[i].taskNodes[n])
                            if ($scope.wfJsonData.routes[i].taskNodes[n].users && $scope.wfJsonData.routes[i].taskNodes[n].users.length > 0) {
                                if ($scope.wfJsonData.routes[i].taskNodes[n].showNodeUsers === 0) {
                                    // 自动全选、并且不显示处理人，使用候选处理人做为下一环节处理人
                                    let nextUsers = ''
                                    $scope.wfJsonData.routes[i].taskNodes[n].users.forEach(tnUser => {
                                        if (nextUsers !== '') nextUsers += ';'
                                        nextUsers += tnUser.orgFullName + ':' + tnUser.name + '/' + tnUser.account + '@' + tnUser.id
                                    })

                                    delete $scope.wfJsonData.routes[i].taskNodes[n].users
                                    submitTemplate.nextTNProp.push($scope.wfJsonData.routes[i].taskNodes[n])
                                    submitTemplate.nextTNUser.push(nextUsers)
                                } else if ($scope.wfJsonData.routes[i].mustNextTN.indexOf($scope.wfJsonData.routes[i].taskNodes[n].name) !== -1) {
                                    wfNodeChecked = false
                                }
                            }
                        }
                    }
                    break // i
                }
            }
            return routeChecked && wfNodeChecked && wfUserChecked
        },
        async setAttend($scope, wfItemList, attend, itemType) {
            const ids = []
            wfItemList.forEach(wfItem => {
                ids.push(wfItem.id)
            })
            if (ids.length === 0) {
                this.$alert('请选择需要' + ((attend === 1 || attend === '1') ? '添加' : '取消') + '关注的文件！', '操作提示', { type: 'warning' })
                return
            }
            const res = await this.$wfEngine.setAttend($scope, ids.join(','), attend, itemType)
            if (res.code === 'success') {
                this.$message({ type: res.code, message: res.message, showClose: true })

                const btnRefresh = document.querySelector('.el-icon-refresh')
                if (btnRefresh !== null) btnRefresh.parentElement.click()
            } else {
                this.$alert(res.message, '操作提示', { type: 'error' })
            }
        },
        async forwardTodo($scope, wfItemList) {
            if (wfItemList.length === 0) {
                this.$alert('请选择需要转派的文件！', '操作提示', { type: 'warning' })
                return
            }

            // 代码模拟触发指令
            const el = {
                attrs: { 'dialog-title': '选择转办接收人' }
            }
            const vnode = {
                context: this,
                data: {
                    attrs: { 'old-value': '' },
                    model: { 'value': '', 'expression': 'to' }
                }
            }
            this.$bus.emit('openSelectDialog', el, { value: 'staff' }, vnode)
        },
        onSelectStaffCompleted(selectedNodes, attr) {
            if (selectedNodes.length > 0) {
                const newOwner = selectedNodes[0].name + '@' + selectedNodes[0].id
                let count = 0
                this.wfItemList.forEach(async(wfItem, index) => {
                    const res = await this.$wfEngine.forwardTodo(this.$vnode.context, wfItem, newOwner)
                    if (res.code !== 'success') {
                        this.$alert(res.message, '操作提示', { type: 'error' })
                    } else {
                        count++
                    }

                    if ((index + 1) === this.wfItemList.length) {
                        this.$message({ type: 'success', message: '共转办' + count + '份文件', showClose: true })
                        const btnRefresh = document.querySelector('.el-icon-refresh')
                        if (btnRefresh !== null) btnRefresh.parentElement.click()
                    }
                })
            }
        },
        async setPause($scope, wfItemList, status) {
            const ids = []
            wfItemList.forEach(wfItem => {
                ids.push(wfItem.id)
            })
            if (ids.length === 0) {
                this.$alert('请选择需要' + ((status === 3) ? '挂起' : '解挂') + '的文件！', '操作提示', { type: 'warning' })
                return
            }
            const res = await this.$wfEngine.setPause($scope, ids.join(','), status)
            if (res.code === 'success') {
                this.$message({ type: res.code, message: res.message, showClose: true })

                const btnRefresh = document.querySelector('.el-icon-refresh')
                if (btnRefresh !== null) btnRefresh.parentElement.click()
            } else {
                this.$alert(res.message, '操作提示', { type: 'error' })
            }
        },
        batchRestoreFile($scope, wfItemList) {
            const ids = []
            wfItemList.forEach(wfItem => {
                ids.push(wfItem.wfInstanceId)
            })
            if (ids.length === 0) {
                this.$alert('请选择需要还原的文件！', '操作提示', { type: 'warning' })
                return
            }

            this.$confirm('您是否确认还原已注销文件？', '确认操作', { type: 'warning' })
                .then(() => {
                    $scope.$http({
                        method: 'POST',
                        params: { wfInstanceIds: ids.join(',') },
                        url: 'workflow/wfTaskItemTrash/restoreWfInstance'
                    }).then((response) => {
                        if (response.code === 'success') {
                            this.$message({ type: response.code, message: response.message, showClose: true })

                            const btnRefresh = document.querySelector('.el-icon-refresh')
                            if (btnRefresh !== null) btnRefresh.parentElement.click()
                        } else {
                            this.$alert(response.message, '操作提示', { type: 'error' })
                        }
                    })
                })
                .catch(err => {
                    if (err !== 'cancel') {
                        console.error(err)
                    }
                })
        },
        handleSubmitForm() {
            const submitType = 'BatchSubmit'
            const res = this.$wfEngine.checkSubmitHandle(this, submitType)
            if (res.code !== 'success') {
                this.$alert(res.message, '操作提示', { type: 'warning' })
                return
            }
            const wfParams = getQueryObject(this.wfItemList[this.processIndex].itemUrl)
            this.$wfEngine.checkOuterDeputy(this, wfParams).then(res => {
                if (res.code !== 'success') {
                    this.$alert(res.message, '操作提示', { type: 'error' })
                } else {
                    if (this.actionType !== 'oneTodo' && this.actionType !== 'continue') {
                        this.showSubmitHandle = false
                    }
                    this.$wfEngine.saveWfInstance(this, submitType, wfParams).then(res => {
                        if (res.code === 'success') {
                            this.submitedFile[this.wfItemList[0].itemUrl] = { 'icon': 'check' }
                            this.$set(this.wfItemList[this.processIndex], 'icon', 'check')

                            this.processFile(this.processIndex + 1, res.submitHandle)
                        } else {
                            this.submitedFile[this.wfItemList[this.processIndex].itemUrl] = { 'icon': 'close' }
                            this.$set(this.wfItemList[this.processIndex], 'icon', 'close')
                            this.$alert(res.message, '操作提示', { type: 'error' })

                            this.showSubmitHandle = true
                        }
                    })
                }
            })
        },
        handleDialogClose() {
            this.dialogFormVisible = false
            this.showSubmitHandle = false
            this.wfItemList = []
            this.wfInstance = {}
            this.vo = {}
            this.wfJsonData = {}
            this.submitHandle = null
            this.commonIdeaList = []
            this.submitTemplateList = []
            this.curTN = {}
            this.attachments = []
            this.submitedFile = {}
        }
    }
}
</script>

<style scoped lang="scss">
/deep/ .el-dialog__body{
    min-height:500px;
}
.el-icon-loading{
    font-size: 20px;
    font-weight: 900
}
.el-icon-check{
    color:green;
    font-size: 20px;
    font-weight: 900
}
.el-icon-close{
    color:red;
    font-size: 20px;
    font-weight: 900
}
</style>
